<%@page contentType="text/html" pageEncoding="UTF-8" import="ejb.Cliente" %>
<%Cliente user = (Cliente) session.getAttribute("cliente");%>
<%if (user != null) {%>
Sei loggato come: <%= user.getUserName()%>
<form action="ServletMain" method="POST" name="dati">
        <input type="hidden" name="op" value="logout"/>
        <input type="submit" value="LOGOUT"/>
</form>
<%} else {%>
<h3>Login</h3>
<form action="ServletMain" method="POST" name="dati">
    <input type="hidden" name="op" value="login"/>
    <table>
        <tr><td>User:</td><td><input name="username" type="text"/></td></tr>
        <tr><td>Password:</td><td><input name="password" type="password"/></td></tr>
        <tr><td>&nbsp;</td><td><input type="submit" value="LOGIN"/></td></tr>
    </table>
</form>
<%}%>